﻿@model RechercheEmplois.Models.Offre

@{
    ViewBag.Title = "Create";
}

<h2>Ajoutez un nouveau offre</h2>
<hr />
@using (Html.BeginForm()) 
{
   <div class="form-horizontal">
        @Html.ValidationSummary(true)

        <div class="form-group">
            @Html.LabelFor(model => model.Libelle, new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.Libelle, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Libelle)
            </div>
        </div>

       <div class="form-group">
            @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.TextAreaFor(model => model.Description, new { @class = "form-control", @rows = 10 })
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>
       
       <div class="form-group">
           @Html.LabelFor(model => model.TagWords, new { @class = "control-label col-md-2" })
           <div class="col-md-4">
               @Html.TextBoxFor(model => model.TagWords, new { @class = "form-control"})
               @Html.ValidationMessageFor(model => model.TagWords)
           </div>
       </div>

       <div class="form-group">
           @Html.LabelFor(model => model.NiveauEtude, new { @class = "control-label col-md-2" })
           <div class="col-md-4">
               @Html.TextBoxFor(model => model.NiveauEtude, new { @class = "form-control" })
               @Html.ValidationMessageFor(model => model.NiveauEtude)
           </div>
       </div>

       <div class="form-group">
            @Html.LabelFor(model => model.HoraireTravail, new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.HoraireTravail, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.HoraireTravail)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.RenumHoraire, new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.RenumHoraire, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.RenumHoraire)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DebutContrat, new { @class = "control-label col-md-2" })
            <div class="col-md-4" id="dateDebutPicker">
                @Html.TextBoxFor(model => model.DebutContrat, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.DebutContrat)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.FinContrat, new { @class = "control-label col-md-2" })
            <div class="col-md-4" id="dateFinPicker">
                @Html.TextBoxFor(model => model.FinContrat, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.FinContrat)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ExpMin, new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.TextBoxFor(model => model.ExpMin, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.ExpMin)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Commentaire, new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.TextAreaFor(model => model.Commentaire, new { @class = "form-control", @rows = 3 })
                @Html.ValidationMessageFor(model => model.Commentaire)
            </div>
        </div>

       <div class="form-group">
            @Html.LabelFor(model => model.Type, new { @class = "control-label col-md-2" })
           <div class="col-md-4">
               @Html.DropDownList("Type", (List<SelectListItem>)ViewBag.Types, "---Choisir un type de contract---", new { @class = "selectpicker show-tick", data_live_search = "true" })
               @Html.ValidationMessageFor(model => model.Type)
           </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DomaineID, "DomaineID", new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.DropDownList("DomaineID", (List<SelectListItem>)ViewBag.listeDomaines, "---Choisir un secteur---", new { @class = "selectpicker show-tick", data_live_search = "true" })
                @Html.ValidationMessageFor(model => model.DomaineID)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.VilleID, "VilleID", new { @class = "control-label col-md-2" })
            <div class="col-md-4">
                @Html.DropDownList("VilleID", (List<SelectListItem>)ViewBag.listeVilles, "---Choisir une ville---", new { @class = "selectpicker show-tick", data_live_search = "true" })
                @Html.ValidationMessageFor(model => model.VilleID)
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Create" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")

}

<script type="text/javascript">
    $(document).ready(function () {
        $('#dateDebutPicker input').datepicker({
        });
        $('#dateFinPicker input').datepicker({
        });
        //inicialization of select picker
        $('.selectpicker').selectpicker();
    });
</script>